package com.iias.common.constants.content;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;


/**
 * 应用上下文
 */
public class TreadContent {

    /**
     * 线程ID
     */
    private Long thredId;

    private LinkedHashMap<String,Object> attributes = new LinkedHashMap<String, Object>();

    /**
     * 线程号 对应 数据
     */
    private List<Object> dataList = new ArrayList<Object>();


    public void add(Object ... objs){
        for (Object obj : objs) {
            dataList.add(obj);
        }
    }

    public List<Object> all(){
        return dataList;
    }


    public void setAttributes(String key,Object value){
        attributes.put(key,value);
        return;
    }

    public <T> T getAttribute(String key){
        return (T) attributes.get(key);
    }


}
